package com.fingard.dsp.bank.reqrespobj.enumeration;


import java.util.Map;
import java.util.TreeMap;

/**
 * Created by cludy on 2019-11-12.
 * 直联权限
 */
public enum ENDirectRight implements PersistEnum<ENDirectRight> {

    /**
     * 查询
     */
    QUERY("1"),
    /**
     * 结算
     */
    SETTLEMENT("2"),
    /**
     * 电票
     */
    ELEDRAFT("3"),
    /**
     * 银行存单
     */
    BANKTERMDEPOSITS("4"),
    /**
     * 现金池
     */
    CASHPOOLS("5")
    ;

    private String value;

    ENDirectRight(String value){
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    private static final Map<String, ENDirectRight> map = new TreeMap<String, ENDirectRight>();

    static {
        map.put(QUERY.getValue(), QUERY);
        map.put(SETTLEMENT.getValue(), SETTLEMENT);
        map.put(ELEDRAFT.getValue(), ELEDRAFT);
        map.put(BANKTERMDEPOSITS.getValue(), BANKTERMDEPOSITS);
        map.put(CASHPOOLS.getValue(), CASHPOOLS);
    }

    @Override
    public String getPersistedValue() {
        return getValue();
    }

    @Override
    public ENDirectRight returnEnum(String persistedValue) {
        return map.get(persistedValue);
    }

    @Override
    public Map<String, ENDirectRight> getAllValueMap() {
        return map;
    }
}
